From e45a25012b768258266fc9a67ab12f511f7edabb Mon Sep 17 00:00:00 2001 From: tee-too Date: Fri, 17 Mar 2017 14:52:31 +0100 Subject: [PATCH] Remove --cap-lints feature detection (fix issue #3828) --- src/cargo/ops/cargo_rustc/mod.rs | 12 ++---------- src/cargo/util/rustc.rs | 15 +++------------ tests/git.rs | 5 +---- 3 files changed, 6 insertions(+), 26 deletions(-) diff --git a/src/cargo/ops/cargo_rustc/mod.rs b/src/cargo/ops/cargo_rustc/mod.rs index 0cac00a95..2ebbb1962 100644 --- a/src/cargo/ops/cargo_rustc/mod.rs +++ b/src/cargo/ops/cargo_rustc/mod.rs @@ -253,20 +253,12 @@ fn rustc(cx: &mut Context, unit: &Unit, exec: Arc) -> CargoResult CargoResult { let mut cmd = util::process(&path); cmd.arg("-vV"); - - let mut first = cmd.clone(); - first.arg("--cap-lints").arg("allow"); - - let (cap_lints, output) = match first.exec_with_output() { - Ok(output) => (true, output), - Err(..) => (false, cmd.exec_with_output()?), - }; - + + let output = cmd.exec_with_output()?; + let verbose_version = String::from_utf8(output.stdout).map_err(|_| { internal("rustc -v didn't return utf8 output") })?; @@ -46,7 +38,6 @@ impl Rustc { path: path, verbose_version: verbose_version, host: host, - cap_lints: cap_lints, }) } diff --git a/tests/git.rs b/tests/git.rs index 29b100ed8..70dd4e4b8 100644 --- a/tests/git.rs +++ b/tests/git.rs @@ -8,7 +8,7 @@ use std::io::prelude::*; use std::path::Path; use cargo::util::process; -use cargotest::{sleep_ms, RUSTC}; +use cargotest::sleep_ms; use cargotest::support::paths::{self, CargoPathExt}; use cargotest::support::{git, project, execs, main_file, path2url}; use hamcrest::{assert_that,existing_file}; @@ -1743,9 +1743,6 @@ fn lints_are_suppressed() { #[test] fn denied_lints_are_allowed() { - let enabled = RUSTC.with(|r| r.cap_lints); - if !enabled { return } - let a = git::new("a", |p| { p.file("Cargo.toml", r#" [project] -- 2.30.2